<?php

include_once 'DAO/CityDAO.class.php';

$name = $_GET['query'];
$getCountry = $_GET['getCountry'];
$cityDao = new CityDAO();

if($getCountry == 0){
    $cities = $cityDao->retrieveCities($name);
    if($cities != ''){
        $separetedCities = implode("/", $cities);
        echo $separetedCities;
    }
    else
        echo '';
    
}

if($getCountry == 1){
    $country = $cityDao->retrieveCountry($name);
    echo $country;
}


?>
